package com.xx.common.api;


import com.xx.common.pojo.XxlJobInfo;

/**
 * core job action for xxl-job
 *
 * @author xuxueli 2016-5-28 15:30:33
 */
public interface XxlJobService {


    /**
     * add job
     *
     * @param jobInfo 任务
     * @return 新增结果
     */
    public Boolean add(XxlJobInfo jobInfo) throws Exception;

    /**
     * 根据执行器任务handler修改任务
     *
     * @param jobInfo 任务
     * @return 修改结果
     */
    public Boolean update(XxlJobInfo jobInfo) throws Exception;

    /**
     * remove job
     * *
     *
     * @param executorHandler 执行任务标识
     * @return 移除结果
     */
    public Boolean remove(String executorHandler) throws Exception;

    /**
     * start job
     *
     * @param executorHandler 执行任务标识
     * @return 开启结果
     */
    public Boolean start(String executorHandler) throws Exception;

    /**
     * stop job
     *
     * @param executorHandler 执行任务标识
     * @return 暂停结果
     */
    public Boolean stop(String executorHandler) throws Exception;


}
